_Pragma("once");

#include <ctime>
#include <algorithm>

#include "EditablePage.h"
#include "DateTimeUtility.h"
#include "StringUtility.h"
#include "MultiPage.h"
#include "common.h"
#include "StringListEditor.h"



/**
 * 第七页 显示上一条离线指令页面
 * @author lizb
 */
class OfflineCommandPage : public MultiPage<EditablePage> {
    using super = MultiPage<EditablePage>;

public:

    OfflineCommandPage(const int pageNum, const std::string& title = "executed:", const int32_t factor = -1, const int32_t base = -1) : super(pageNum), mtitle(title), mfactor(factor), mbase(base) {

    }

    void beforeDisplay() override ;


    void paint() override;


    void initEditors() override {
        const StringVectorPtr deleteLabelPtr{new StringVectorPtr::element_type{"delete"}};

        BasicEditor* pEditor = new StringListEditor(3, 10, 15, deleteLabelPtr);
        editUnits.push_back(BasicEditorSharedPtr(pEditor));

    }


    /**
     * 为可编辑单元设置初始值
     * 需要在进入编辑模式 和 初始化的时候调用
     */
    void setValue() override {

    }


    /**
     * 设置时间数据
     */
     void saveValue() override;


    std::string mtitle;
    int32_t mfactor;
    int32_t mbase;
};
